package com.lxh.lxhcrm.model.pojos;

import javax.persistence.*;
import java.util.List;
import java.util.Objects;

/**
 * 客户行为记录表
 */
@Entity
@Table(name = "behavior_record", schema = "lxh_crm", catalog = "")
public class BehaviorRecord {
    private int behaviorRecordId;
    //private Integer actionRecordId;
    private  ActionRecord actionRecord;  //客户行为记录对员工行动记录多对一
    private String behaviorCont;
    private Behavior behavior;      /*客户行为分值表 一对一*/
//    private Integer behaviorId;
    private Customer customer;      /*客户 多对一*/
//    private Integer customerId;

    @OneToOne
    @JoinColumn(name = "behavior_id", referencedColumnName = "behavior_id")
    public Behavior getBehavior() {
        return behavior;
    }
    public void setBehavior(Behavior behavior) {
        this.behavior = behavior;
    }

    @ManyToOne(cascade = CascadeType.REFRESH)
    @JoinColumn(name = "customer_id", referencedColumnName = "customer_id")
    public Customer getCustomer() {
        return customer;
    }
    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    @ManyToOne(cascade = CascadeType.REFRESH)
    @JoinColumn(name = "action_record_id", referencedColumnName = "action_record_id")
    public ActionRecord getActionRecord() {return actionRecord; }
    public void setActionRecord(ActionRecord actionRecord) {this.actionRecord = actionRecord; }

    @Id
    @Column(name = "behavior_record_id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public int getBehaviorRecordId() {
        return behaviorRecordId;
    }

    public void setBehaviorRecordId(int behaviorRecordId) {
        this.behaviorRecordId = behaviorRecordId;
    }


    @Basic
    @Column(name = "behavior_cont", nullable = true, length = 200)
    public String getBehaviorCont() {
        return behaviorCont;
    }

    public void setBehaviorCont(String behaviorCont) {
        this.behaviorCont = behaviorCont;
    }


}
